package com.java4.exer;

import com.java3.util.JDBCUtils;

import java.util.Scanner;

/**
 * @author jingjintao
 * @date 2021/6/9 - 21:42
 **/
public class Exer1Test {

    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        System.out.print("请输入用户名：");
        final String name = scanner.next();
        System.out.print("请输入邮箱：");
        final String email = scanner.next();
        System.out.print("请输入生日：");
        final String birth = scanner.next();

        String sql="insert into customers(name,email,birth) values(?,?,?)";
        final int insertCount = JDBCUtils.update(sql, name, email, birth);
        if(insertCount >0){
            System.out.println("添加成功");
        }else{
            System.out.println("添加失败");
        }
    }
}
